package jy.game.components.map;


import android.text.TextUtils;

import wx.xml.simpleframework.xml.Attribute;
import wx.xml.simpleframework.xml.Root;

@Root(name = "location")
public class JyMapLocation extends JyMapRole {
    @Attribute public int x;
    @Attribute public int y;

    public String getName() {
        if (this.name.equals("女主")) {
            return "女主";// RuntimeData.Instance.femaleName();
        }
        return this.name;
    }

    // (get) Token: 0x0600042E RID: 1070 RVA: 0x00004532 File Offset: 0x00002732
    // [XmlIgnore]
    public int X() {
        {
            return this.x * 1140 * 2 / 800 + 18;
        }
    }

    // (get) Token: 0x0600042F RID: 1071 RVA: 0x0000454B File Offset: 0x0000274B
    // [XmlIgnore]
    public int Y() {
        {
            return -this.y * 640 * 2 / 600 - 8;
        }
    }

    public String GetImageKey() {
        for (JyMapEvent mapEvent : this.events) {
            if (!TextUtils.isEmpty(mapEvent.image) && mapEvent.type == "map") {
                return mapEvent.image;
            }
        }
        return "";
    }
}